<%@ page import="org.jasig.cas.client.validation.Assertion" %>
<%@ page import="org.jasig.cas.client.authentication.AttributePrincipal" %>
<%@ page import="org.jasig.cas.client.util.AssertionHolder" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2018/4/24
  Time: 20:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <meta charset="UTF-8">
    <title>智能报修系统——运维人员业绩</title>
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>resources/css/rightDiv.css"/>
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>resources/css/manager.css"/>
    <!--引入交互所需css-->
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>resources/css/jNotify.jquery.css"/>
    <%--<script src="<%= request.getContextPath()%>resources/js/manager.js" type="text/javascript" charset="utf-8"></script>--%>
</head>
<body ng-app="managerApp">
<%System.out.println(basePath);%>

<!--头部开始-->
<%
    Assertion assertion = AssertionHolder.getAssertion();

    AttributePrincipal ap =  assertion.getPrincipal();   //获取AttributePrincipal对象，这是客户端对象

    String name = ap.getName();

    Map<String,Object> att = ap.getAttributes();//获取属性值，为一个Map类型。

%>

<div id="head">
    <div id="head_con">
        <p class="title">智能报修系统</p>
        <div class="phoneNum" ng-controller="servicenumCtrl">
            服务电话：
            <span id="servicenum">
					{{servicephone}}
				</span>
        </div>
    </div>

</div>
<!--头部结束-->

<!--左边开始-->
<div id="staffLeft">
    <div id="staffLeftCon">
        <!--管理人员的信息-->
        <div id="staffInfo">
            <!--姓名-->
            <p class="staffName">Administrator</p>
            <!--客服学号-->
            <!--<p class="staffNum">1506111111</p>-->
            <p class="staffNum"><%=name %></p>
            <input type="hidden" class="useraccount" value="<%=name %>"/>
            <!--职位-->
            <p class="place">管理人员</p>
        </div>


        <style>
            #operation a:link,a:visited,a:hover{
                text-decoration: none;
                color:#4e7500;
            }
        </style>
        <div id="operation">
            <ul>
                <a href="/complainli"><li id="complainli"  >投诉管理 </li></a>
                <a href="/tiao1"><li id="createli"  >创建工单</li></a>
                <a href="/ordermanageli"><li id="ordermanageli">工单管理</li></a>
                <a href="/tiao2"> <li id="faultli" >故障分类管理</li></a>
                <a href="/totalorderli"><li id="totalorderli">工单统计报表</li></a>
                <a href="/yeji"><li id="performancesli" class="active">运维人员业绩</li></a>
                <a href="/worktypeli"><li id="worktypeli">运维人员管理</li></a>
                <a href="/guanli"><li id="websiteli">网站管理</li></a>
            </ul>
        </div>
    </div>
</div>
<!--左边结束-->

<!--右边开始-->
<div id="pushOrdersRight">
    <div id="pushOrdersRight_con">

        <%--class="turndiv" --%>
        <!--运维人员业绩开始-->
        <div id="performances"  ng-controller="performanceCtrl">
            <div class="sort">
                <a>分类:</a>
                <a class="sort_con perfor" ng-click="querybyperformance()">业绩</a>
                <a class="sort_con starcomplain" ng-click="querybystar()">星级与投诉</a>
                <a>年份：</a>
                <select class="sort_con" ng-model="selecttime" ng-options="t.ttt for t in times">
                </select>
            </div>
            <table id="oper_perf_table">
                <tr>
                    <th class="xi">人员/月份</th>
                    <th>1月</th>
                    <th>2月</th>
                    <th>3月</th>
                    <th>4月</th>
                    <th>5月</th>
                    <th>6月</th>
                    <th>7月</th>
                    <th>8月</th>
                    <th>9月</th>
                    <th>10月</th>
                    <th>11月</th>
                    <th>12月</th>
                    <th>合计</th>
                </tr>
                <tr ng-repeat="(key,p) in performancetoper">
                    <td class="xi">{{p.userName | isnull}}</td><!--名字-->
                    <td>{{p.jan | isnull}}</td>
                    <td>{{p.feb | isnull}}</td>
                    <td>{{p.mar | isnull}}</td>
                    <td>{{p.apr | isnull}}</td>
                    <td>{{p.may | isnull}}</td>
                    <td>{{p.jun | isnull}}</td>
                    <td>{{p.jul | isnull}}</td>
                    <td>{{p.aug | isnull}}</td>
                    <td>{{p.sep | isnull}}</td>
                    <td>{{p.oct | isnull}}</td>
                    <td>{{p.nov | isnull}}</td>
                    <td>{{p.dec | isnull}}</td>
                    <td>{{p.jan+p.feb+p.mar+p.apr+p.may+p.jun+p.jul++p.aug+p.sep+p.oct+p.nov+p.dec | isnull}}</td>
                </tr>
            </table>
            <table id="oper_star_table">
                <tr>
                    <th class="bold">人员</th>
                    <th class="bold">星级</th>
                    <th class="bold">投诉</th>
                </tr>
                <tr ng-repeat="s in perstar">
                    <td>{{s.userName | isnull}}</td>
                    <td>{{s.commentStar | isnull}}</td>
                    <td>{{s.commentContent | isnull}}</td>
                </tr>
            </table>

            <%--分页代码--%>
            <%--<div class="turnpagediv">--%>
                <%--<button class="prepage">上一页</button>--%>
                <%--<p class="currentpage">当前第1页</p>--%>
                <%--<button class="nextpage">下一页</button>--%>
            <%--</div>--%>
        </div>
        <!--运维人员业绩结束-->



    </div>
</div>
<!--右边结束-->
<%--<div id="footer" class="footer">--%>
    <%--<p class="footerWord">版权所有&nbsp;四川旅游学院</p>--%>
<%--</div>--%>
<!--引入交互所需文件-->
<script type="text/javascript" src="<%= request.getContextPath()%>resources/js/jquery-3.1.1.min.js"></script>
<script src="<%= request.getContextPath()%>resources/js/angular.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<%= request.getContextPath()%>resources/js/managerController.js" type="text/javascript"
        charset="utf-8"></script>
<script type="text/javascript" src="<%= request.getContextPath()%>resources/js/jNotify.jquery.js"></script>

<script>
//    运维人员业绩分类切换
function $(id){
    return document.getElementById(id);
}
function styleDisplayBlock(ele){//点击元素显示
    return ele.style.display="block";
}
function styleDisplaynone(ele){//点击元素隐藏
    return ele.style.display="none";
}

    var perfor=document.getElementsByClassName("perfor")[0];
    var starcomplain=document.getElementsByClassName("starcomplain")[0];
    var oper_perf_table=$("oper_perf_table");
    var oper_star_table=$("oper_star_table");

    perfor.onclick=function(){
        styleDisplayBlock(oper_perf_table);
        styleDisplaynone(oper_star_table);
    };

    starcomplain.onclick=function(){
        styleDisplaynone(oper_perf_table);
        styleDisplayBlock(oper_star_table);
    };

</script>
</body>
</html>
